package com.example.demotest.repository;

import com.example.demotest.pojo.Message;
import org.springframework.data.jpa.repository.JpaRepository;
import java.util.List;

public interface MessageRepository extends JpaRepository<Message, Long> {
    List<Message> findByChatIdOrderByTimestampAsc(Long chatId);
    List<Message> findByChatIdOrderByTimestampDesc(Long chatId);
}